package com.bamboowind.controller;

import com.bamboowind.pojo.OrderInfo;
import com.bamboowind.service.OrderInfoService;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Blue
 */
@RestController
public class OrderInfoController {

    @Autowired
    private OrderInfoService orderInfoService;

    @GetMapping("/limit/{pageNow}/{pageSize}")
    public List<OrderInfo> getOrderInfoListByLimit(@PathVariable int pageNow, @PathVariable int pageSize) {
        return orderInfoService.getOrderInfoListByLimit(pageNow, pageSize);
    }

    @GetMapping("/rowBounds/{pageNow}/{pageSize}")
    public List<OrderInfo> getOrderInfoListByRowBounds(@PathVariable int pageNow, @PathVariable int pageSize) {
        return orderInfoService.getOrderInfoListByRowBounds(pageNow, pageSize);
    }

    @GetMapping("/pageHelper/{pageNow}/{pageSize}")
    public List<OrderInfo> getOrderInfoListByPageHelper(@PathVariable int pageNow, @PathVariable int pageSize) {
        return orderInfoService.getOrderInfoListByPageHelper(pageNow, pageSize);
    }

    @GetMapping("/mp/{pageNow}/{pageSize}")
    public IPage<OrderInfo> getOrderInfoListByMp(@PathVariable int pageNow, @PathVariable int pageSize) {
        return orderInfoService.getOrderInfoListByMp(pageNow, pageSize);
    }
}
